Optimal. Leaf size=68 \[ -\frac {a x}{b^2}-\frac {2 \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\cosh (c+d x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2774, 2814,
2739, 632, 210} \begin {gather*} -\frac {2 \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b^2 d}-\frac {a x}{b^2}+\frac {\cosh (c+d x)}{b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2774
Rule 2814
Rubi steps
\begin {align*} \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx &=\frac {\cosh (c+d x)}{b d}+\frac {i \int \frac {-i b+i a \sinh (c+d x)}{a+b \sinh (c+d x)} \, dx}{b}\\ &=-\frac {a x}{b^2}+\frac {\cosh (c+d x)}{b d}+\frac {\left (a^2+b^2\right ) \int \frac {1}{a+b \sinh (c+d x)} \, dx}{b^2}\\ &=-\frac {a x}{b^2}+\frac {\cosh (c+d x)}{b d}-\frac {\left (2 i \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a-2 i b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (i c+i d x)\right )\right )}{b^2 d}\\ &=-\frac {a x}{b^2}+\frac {\cosh (c+d x)}{b d}+\frac {\left (4 i \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2+b^2\right )-x^2} \, dx,x,-2 i b+2 a \tan \left (\frac {1}{2} (i c+i d x)\right )\right )}{b^2 d}\\ &=-\frac {a x}{b^2}-\frac {2 \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\cosh (c+d x)}{b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.03, size = 458, normalized size = 6.74 \begin {gather*} \frac {\cosh (c+d x) \left (-2 \sqrt {a-i b} \sqrt {a+i b} \tanh ^{-1}\left (\frac {\sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}}{\sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}}}\right ) \sqrt {1+i \sinh (c+d x)}+2 (a-i b) \tanh ^{-1}\left (\frac {\sqrt {a-i b} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}}{\sqrt {a+i b} \sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}}}\right ) \sqrt {1+i \sinh (c+d x)}+\sqrt {a+i b} \sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}} \left (-2 (-1)^{3/4} \sqrt {b} \text {ArcSin}\left (\frac {\sqrt [4]{-1} \sqrt {a-i b} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}}{\sqrt {2} \sqrt {b}}\right )+\sqrt {a-i b} \sqrt {1+i \sinh (c+d x)} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}\right )\right )}{\sqrt {a-i b} \sqrt {a+i b} b d \sqrt {1+i \sinh (c+d x)} \sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(128\) vs.
\(2(63)=126\).
time = 1.21, size = 129, normalized size = 1.90
method | result | size |
risch | \(-\frac {a x}{b^{2}}+\frac {{\mathrm e}^{d x +c}}{2 b d}+\frac {{\mathrm e}^{-d x -c}}{2 b d}+\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{d x +c}-\frac {-a +\sqrt {a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}-\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{d x +c}+\frac {a +\sqrt {a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}\) | \(122\) |
derivativedivides | \(\frac {-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}+\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}-\frac {2 \left (-a^{2}-b^{2}\right ) \arctanh \left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}}{d}\) | \(129\) |
default | \(\frac {-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}+\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}-\frac {2 \left (-a^{2}-b^{2}\right ) \arctanh \left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}}{d}\) | \(129\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 116, normalized size = 1.71 \begin {gather*} -\frac {{\left (d x + c\right )} a}{b^{2} d} + \frac {e^{\left (d x + c\right )}}{2 \, b d} + \frac {e^{\left (-d x - c\right )}}{2 \, b d} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {b e^{\left (-d x - c\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-d x - c\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{b^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 259 vs.
\(2 (65) = 130\).
time = 0.35, size = 259, normalized size = 3.81 \begin {gather*} -\frac {2 \, a d x \cosh \left (d x + c\right ) - b \cosh \left (d x + c\right )^{2} - b \sinh \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right )} \log \left (\frac {b^{2} \cosh \left (d x + c\right )^{2} + b^{2} \sinh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (d x + c\right ) + a b\right )} \sinh \left (d x + c\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right ) + a\right )}}{b \cosh \left (d x + c\right )^{2} + b \sinh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) + 2 \, {\left (b \cosh \left (d x + c\right ) + a\right )} \sinh \left (d x + c\right ) - b}\right ) + 2 \, {\left (a d x - b \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) - b}{2 \, {\left (b^{2} d \cosh \left (d x + c\right ) + b^{2} d \sinh \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 503 vs.
\(2 (58) = 116\).
time = 86.39, size = 503, normalized size = 7.40 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x \cosh ^{2}{\left (c \right )}}{\sinh {\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {- \frac {x \sinh ^{2}{\left (c + d x \right )}}{2} + \frac {x \cosh ^{2}{\left (c + d x \right )}}{2} + \frac {\sinh {\left (c + d x \right )} \cosh {\left (c + d x \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {x \cosh ^{2}{\left (c \right )}}{a + b \sinh {\left (c \right )}} & \text {for}\: d = 0 \\\frac {\frac {\log {\left (\tanh {\left (\frac {c}{2} + \frac {d x}{2} \right )} \right )} \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - d} - \frac {\log {\left (\tanh {\left (\frac {c}{2} + \frac {d x}{2} \right )} \right )}}{d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - d} - \frac {2}{d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - d}}{b} & \text {for}\: a = 0 \\- \frac {a d x \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} + \frac {a d x}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} - \frac {2 b}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} - \frac {\sqrt {a^{2} + b^{2}} \log {\left (\tanh {\left (\frac {c}{2} + \frac {d x}{2} \right )} - \frac {b}{a} - \frac {\sqrt {a^{2} + b^{2}}}{a} \right )} \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} + \frac {\sqrt {a^{2} + b^{2}} \log {\left (\tanh {\left (\frac {c}{2} + \frac {d x}{2} \right )} - \frac {b}{a} - \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} + \frac {\sqrt {a^{2} + b^{2}} \log {\left (\tanh {\left (\frac {c}{2} + \frac {d x}{2} \right )} - \frac {b}{a} + \frac {\sqrt {a^{2} + b^{2}}}{a} \right )} \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} - \frac {\sqrt {a^{2} + b^{2}} \log {\left (\tanh {\left (\frac {c}{2} + \frac {d x}{2} \right )} - \frac {b}{a} + \frac {\sqrt {a^{2} + b^{2}}}{a} \right )}}{b^{2} d \tanh ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - b^{2} d} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 110, normalized size = 1.62 \begin {gather*} -\frac {\frac {2 \, {\left (d x + c\right )} a}{b^{2}} - \frac {e^{\left (d x + c\right )}}{b} - \frac {e^{\left (-d x - c\right )}}{b} - \frac {2 \, \sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{b^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.42, size = 121, normalized size = 1.78 \begin {gather*} \frac {{\mathrm {e}}^{c+d\,x}}{2\,b\,d}-\frac {2\,\mathrm {atan}\left (\frac {a\,\sqrt {-b^4\,d^2}}{b^2\,d\,\sqrt {a^2+b^2}}+\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {-b^4\,d^2}}{b\,d\,\sqrt {a^2+b^2}}\right )\,\sqrt {a^2+b^2}}{\sqrt {-b^4\,d^2}}+\frac {{\mathrm {e}}^{-c-d\,x}}{2\,b\,d}-\frac {a\,x}{b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________